<!--conf
<sample in_favorites="true">
              <product version="1.6" edition="pro"/>
                     <modifications>
                            <modified date="080512"/>
                     </modifications>
<sampledescription><![CDATA[Smart rendering is the technology which allows dhtmlxGrid users work with really huge datasets. Since v.1.6 it is available for tree structures also.]]></sampledescription></sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Smart Rendering in dhtmlxTreeGrid</title>
	
	<link rel="STYLESHEET" type="text/css" href="../../../dhtmlxGrid/codebase/dhtmlxgrid.css">
	<link rel="STYLESHEET" type="text/css" href="../../../dhtmlxGrid/codebase/dhtmlxgrid_skins.css">
	<script  src="../../../dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
	<script  src="../../../dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
	<script  src="../../../dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js"></script>
	<script  src="../../../dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
	<script  src="../../codebase/dhtmlxtreegrid.js"></script>
</head>

<script>
var mygrid;
	function doOnLoad(){
		mygrid = new dhtmlXGridObject('gridbox');
		mygrid.imgURL = "../../../dhtmlxGrid/codebase/imgs/icons_greenfolders/";
		mygrid.setHeader("Column A,Column B,Column C");
		mygrid.setInitWidths("*,100,80")
		mygrid.setColAlign("left,left,left")
		mygrid.setColTypes("tree,ed,txt");
		mygrid.setColSorting("str,str,str")
		mygrid.enableSmartRendering(1)
		mygrid.init();
		mygrid.setSkin("xp")
	   	mygrid.loadXML("smartrend.xml");
	}
	function selectAndShow(id){
		mygrid.selectRowById(id);
		mygrid.openItem(mygrid.getParentId(id))
		mygrid.showRow(id);
	}
</script>
<body onload="doOnLoad();">
<link rel='STYLESHEET' type='text/css' href='../common/style.css'>
<table cellspacing="0" cellpadding="0" class="sample_header" border="0">
	<tr valign="middle">
		<!-- COMPONENT ICON -->
		<td width="40" align="center"><img src="../common/dhtmlxtreegrid_icon.gif" border="0"></td>
		<!-- COMPONENT NAME -->
		<td width="150" align="left" nowrap="true">Sample: dhtmlxTreeGrid</td>
		<!-- SAMPLE TITLE -->
		<td width="0" align="left" nowrap><b>Smart Rendering in dhtmlxTreeGrid</b></td>
		<!-- LINK TO COMPONENT PAGE -->
		<td width="0" align="right"><a href="http://www.dhtmlx.com/docs/products/dhtmlxTreeGrid/index.shtml">dhtmlxTreeGrid main page</a></td>
		<!-- CLOSE BUTTON -->
		<td width="50"><div class="sample_close"><a href="javascript:void(0);" onclick="self.close();"><img src="../common/sample_close.gif" width="14" height="14" border="0" alt="X"></a></div></td>
	</tr>
</table>
	
	
	<p>
   Smart Rendering functionality allows to increase performance of the TreeGrid, when it has a lot of nodes per level.<br/>First two items in this sample have 500 child nodes.</p>
	<div id="gridbox" width="500px" height="200px"></div>
	 <a href="javascript:void(0)" onclick='selectAndShow("r0_254")'>Select 255th child of the first item</a><br/>
	 <a href="javascript:void(0)" onclick='selectAndShow("r0_454");'>Select 455th child of the first item</a><br/>
	 <a href="javascript:void(0)" onclick='selectAndShow("r1_199");'>Select 200th child of the second item</a><br/>
           
<div class='sample_code'><div class="hl-main"><pre><span class="hl-code"> 
    </span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">enableSmartRendering</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre></div></div>


<!-- FOOTER -->
<table callspacing="0" cellpadding="0" border="0" class="sample_footer"><tr><td style="padding-left: 8px;">&copy; <a href="http://www.dhtmlx.com">DHTMLX LTD</a>. All rights reserved</td></tr></table>
<!-- FOOTER -->

</body>
</html>
